<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

/*Route::get('/', function () {
    return view('welcome');
});
*/Route::group(['namespace' => 'Home'],function ($router) 
{ 	
	Route::get('/', 'PagesController@root')->name('root');
	Route::post('upload_image', 'TopicsController@uploadImage')->name('topics.upload_image');
	Route::resource('users', 'UsersController', ['only' => ['show', 'update', 'edit']]);
	Route::resource('topics', 'TopicsController', ['only' => ['index', 'show', 'create', 'store', 'update', 'edit', 'destroy']]);
	Route::resource('categories', 'CategoriesController', ['only' => ['show']]);
	Route::resource('replies', 'RepliesController', ['only' => [ 'store','destroy']]);
	Route::resource('notifications', 'NotificationsController', ['only' => ['index']]);
	
    $router->get('paytest', 'TestController@paytest')->name('pay.paytest'); 
    Route::match(['GET', 'POST'], '/pay/notify', ['as'=> 'wxpay.notify', 'uses'=> 'PayController@wxpayNotify']);
});


Route::group(['prefix' => 'mobile','namespace' => 'Mobile','as'=> 'mobile.'],function ($router) 
{ 	

    $router->get('order/blank', 'OrderController@blank')->name('order.blank'); 
    Route::match(['GET', 'POST'], '/pay/notify', ['as'=> 'wxpay.notify', 'uses'=> 'PayController@wxpayNotify']);
    Route::match(['GET', 'POST'], '/wxpay/return', ['as'=> 'wxpay.return', 'uses'=> 'PayController@wxpayReturn']);
});











Auth::routes();//等同于以下
/*// Auth::routes()
Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
Route::post('login', 'Auth\LoginController@login');
Route::post('logout', 'Auth\LoginController@logout')->name('logout');

// Auth::routes()
Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
Route::post('register', 'Auth\RegisterController@register');

// Auth::routes()
Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
Route::post('password/reset', 'Auth\ResetPasswordController@reset');*/

/////
Route::get('/home', 'HomeController@index')->name('home');

//Route::resource('tag','TagController', ['except' => ['show', 'destroy']]);
    //Route::resource('tag','TagController');
    /*请求方式	URI路径				控制器方法	路由名称
	GET			/posts				index	posts.index
	GET			/posts/create		create	posts.create
	POST		/posts				store	posts.store
	GET			/posts/{post}		show	posts.show
	GET			/posts/{post}/edit	edit	posts.edit
	PUT/PATCH	/posts/{post}		update	posts.update
	DELETE		/posts/{post}		destroy	posts.destroy*/

